//
//  WeiboHomeViewController.swift
//  微博
//
//  Created by LH on 2017/5/23.
//  Copyright © 2017年 LH. All rights reserved.
//

import UIKit

class WeiboHomeViewController: WeiboBaseViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
    }
//    显示好友
    @objc fileprivate func showFriends(){
        print("好友" + #function)
        let vc = WeiboDemoViewController()
        //vc.hidesBottomBarWhenPushed=true
        
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension WeiboHomeViewController{
    //重写父类方法
    override func setupUI() {
        super .setupUI()
        //设置导航栏按钮
        //无法高亮
//        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "好友", style: .plain, target: self, action: #selector(showFriends) )
        
        //第二种
//        let but : UIButton = UIButton.cz_textButton("好友", fontSize: 18, normalColor: UIColor.white, highlightedColor: UIColor.orange)
//        but.addTarget(self, action: #selector(showFriends), for: UIControlEvents.touchUpInside)
//        navigationItem.leftBarButtonItem = UIBarButtonItem(customView: but)
        
        //第三种 扩展 遍历构造函数
        navItem.leftBarButtonItem = UIBarButtonItem(title: "好友", fontSize: 15, target: self, action: #selector(showFriends))
    }
}
